//
//  tool.h
//  u76ho
//
//  Created by m-air-01 on 15/12/25.
//  Copyright © 2015年 LV. All rights reserved.
//

#ifndef tool_h
#define tool_h



#pragma mark - 系统信息
//判断系统的版本号
#define SYSTEM_VERSION [[UIDevice currentDevice].systemVersion doubleValue]

//判断手机型号
#define iPhone4 [UIScreen mainScreen].bounds.size.height==480.000000
#define iPhone5 [UIScreen mainScreen].bounds.size.height==568
#define iPhone6 [UIScreen mainScreen].bounds.size.height==667
#define iPhone6P [UIScreen mainScreen].bounds.size.height==1104

#pragma mark - 窗口尺寸
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

#pragma mark - View尺寸
#define SELF_WIDTH self.frame.size.width
#define SELF_HEIGHT self.frame.size.height

#pragma mark - 适配机制
//适配6p宽高
#define SIZETO6PlusH(length) (SCREEN_HEIGHT==1104?length:(length*SCREEN_HEIGHT/1104.0f))
#define SIZETO6PlusW(length) (SCREEN_WIDTH==621?length:(length*SCREEN_WIDTH/621.0f))
//适配6宽高
#define SIZETO6H(length) (SCREEN_HEIGHT==667?length:(length*SCREEN_HEIGHT/667.0f))
#define SIZETO6W(length) (SCREEN_WIDTH==375?length:(length*SCREEN_WIDTH/375.0f))
//适配45宽高
#define SIZETO5H(length) (SCREEN_HEIGHT==568?length:(length*SCREEN_HEIGHT/568.0f))
#define SIZETO5W(length) (SCREEN_WIDTH==320?length:(length*SCREEN_WIDTH/320.0f))
#define SIZETO4H(length) (SCREEN_HEIGHT==480?length:(length*SCREEN_HEIGHT/480.0f))

#define HeitiFont(font) [UIFont fontWithName:@"HeiTi SC" size:font]//字体颜色
#pragma mark - rgb颜色转换（16进制->10进制）
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//本地存贮：是否为第一次使用
#define isFirstUse @"isFirstUse"
//本地存贮：是否已经登录过
#define isLogininged @"isLogined"
#define U76HOURL @"http://www.u76ho.com/"
//高德地图key
#define AMPKey  @"5afdf7bc67e5d636b95c710fa6b85430"




#endif /* tool_h */
